#ifndef MESHLOADER_H_
#define MESHLOADER_H_

#include "DXUT.h"
#include "SDKmisc.h"

#define ERROR_RESOURCE_VALUE 1

namespace Loader
{

    template<typename TYPE> BOOL IsErrorResource( TYPE data )
    {
        if( ( TYPE )ERROR_RESOURCE_VALUE == data )
            return TRUE;
        return FALSE;
    }

    class MeshLoader
    {
    public:
        virtual ~MeshLoader() {};
        virtual HRESULT Create( ID3D10Device* pd3dDevice, const WCHAR* strFilename ) = 0;
        virtual UINT GetNumSubsets() const = 0;
        virtual UINT GetNumMaterials() const = 0 ;
        virtual void Destroy() = 0;
        virtual void DrawSubset(ID3D10Device* pd3dDevice, UINT iSubset) = 0;
        virtual D3DXVECTOR4 GetSubsetMaterialAmbient(UINT iSubset) = 0;
        virtual D3DXVECTOR4 GetSubsetMaterialDiffuse(UINT iSubset) = 0;
        virtual D3DXVECTOR4 GetSubsetMaterialSpecular(UINT iSubset) = 0;
        virtual float GetSubsetMaterialAlpha(UINT iSubset) = 0;
        virtual int GetSubsetMaterialSpecularPower(UINT iSubset) = 0;
        virtual ID3D10ShaderResourceView* GetSubsetMaterialDiffuseTxRV(UINT iSubset) = 0;
        virtual WCHAR* GetSubsetMaterialName(UINT iSubset) = 0;
        virtual ID3D10EffectTechnique* GetSubsetMaterialTech(UINT iSubset) = 0;
        virtual void SetMaterialTech(ID3D10Effect* g_pEffect10) = 0;
        virtual void SetIAVertexIndexBuffer(ID3D10Device* pd3dDevice) = 0;
        virtual float GetAutoViewDistance() = 0;
    };
}


#endif  //MESHLOADER_H_